<template>
  <div>
    <input
      type="text"
      v-model='name'
    >
    child2{{name}}
    <button @click='fn'>按钮</button>
    {{qqq}}
  </div>
</template>
<script>
// @ is an alias to /src
export default {
  name: "child2",
  data() {
    return {
      name: "珠峰培训",
      // qqq: "自己的qqq",
    };
  },
  methods: {
    fn() {
      this.name = 666;
    },
  },
  beforeCreate() {
    console.log(this.name);
  },
  created() {
    console.log("组件自己的created");
  },
  updated() {
    console.log(this.name);
  },
  mounted() {
    //  可以获取到真实的DOM元素
    // window.onunload = () => {
    //   localStorage.setItem("qweqewwqee", "qweqeqeqeqeqe");
    // };
  },
  beforeDestroy() {
    //  一般用来做事件的销毁或者定时器的清除
    console.log("销毁");
  },
  activated() {
    console.log("激活");
  },
  deactivated() {
    console.log("休眠");
  },
  components: {},
};
</script>
<style lang="less">
</style>